import request from '@/utils/request'

const api = {
  login: '/auth/login',
  logout: '/auth/logout',
  userInfo: '/auth/userInfo',
}

export default {
  // 用户登录
  login(data) {
    return request({
      url: api.login,
      method: 'post',
      data
    })
  },
  
  // 用户登出
  logout() {
    return request({
      url: api.logout,
      method: 'post'
    })
  },
  
  // 获取用户信息
  getUserInfo() {
    return request({
      url: api.userInfo,
      method: 'get'
    })
  },
  
}